<!-- grid的容器. -->   
<div id="${parameters.container?default("grid_container")}"></div>   
<script type="text/javascript">
	var gridConfig = {
		id : "${parameters.id?string}",
		dataset : ${parameters.dataset?string},
		columns : ${parameters.columns?string},
		container : "${parameters.container?default('grid_container')}",
		toolbarPosition : "${parameters.toolbarPosition?default('top')}",
		toolbarContent : "${parameters.toolbarContent?default('nav | goto | pagesize | reload | state')}"
		<#if parameters.width?exists>
		, width : "${parameters.width?string}"
		</#if>
		<#if parameters.height?exists>
		, height : "${parameters.height?string}"
		</#if>
		, pageSize : ${parameters.pageSize?default(20)}
		, pageSizeList : ${parameters.pageSizeList?default("[ 10, 20, 25, 50 ]")}
		<#if parameters.loadURL?exists>
		, loadURL : "${parameters.loadURL?string}"
		</#if>
		<#if parameters.saveURL?exists>
		, saveURL : "${parameters.saveURL?string}"
		</#if>	
		<#if parameters.remotePaging?exists>	
		, remotePaging : ${parameters.remotePaging?default(false)?string}
		</#if>
		<#if parameters.resizable?exists>
		, resizable : ${parameters.resizable?default(false)?string}
		</#if>
		<#if parameters.replaceContainer?exists>
		, replaceContainer : ${parameters.replaceContainer?default(false)?string}
		</#if>	
		<#if parameters.customHead?if_exists != "">
		, customHead : "${parameters.customHead?html}"
		</#if>
		<#if parameters.language?if_exists != "">
		, language : "${parameters.language?string}"
		</#if>
		<#if parameters.skin?if_exists != "">
		, skin : "${parameters.skin?string}"
		</#if>		
		<#if parameters.showIndexColumn?exists>
		, showIndexColumn : ${parameters.showIndexColumn?string}
		</#if>														
		<#if parameters.stripeRows?exists>
		, stripeRows : ${parameters.stripeRows?string}
		</#if>	
		<#if parameters.lightOverRow?exists>
		, lightOverRow : ${parameters.lightOverRow?string}
		</#if>	
		<#if parameters.defaultRecord?if_exists != "">
		, defaultRecord : "${parameters.defaultRecord?html}"
		</#if>		
		<#if parameters.transparentMask?exists>
		, transparentMask : ${parameters.transparentMask?string}
		</#if>	
		<#if parameters.clickStartEdit?exists>
		, clickStartEdit : ${parameters.clickStartEdit?string}
		</#if>														
		<#if parameters.reloadAfterSave?exists>
		, reloadAfterSave : ${parameters.reloadAfterSave?string}
		</#if>	
		<#if parameters.recountAfterSave?exists>
		, recountAfterSave : ${parameters.recountAfterSave?string}
		</#if>	
		<#if parameters.showGridMenu?exists>
		, showGridMenu : ${parameters.showGridMenu?string}
		</#if>	
		<#if parameters.allowCustomSkin?exists>
		, allowCustomSkin : ${parameters.allowCustomSkin?string}
		</#if>														
		<#if parameters.allowFreeze?exists>
		, allowFreeze : ${parameters.allowFreeze?string}
		</#if>	
		<#if parameters.allowHide?exists>
		, allowHide : ${parameters.allowHide?string}
		</#if>	
		<#if parameters.allowGroup?exists>
		, allowGroup : ${parameters.allowGroup?string}
		</#if>														
		<#if parameters.selectRowByCheck?exists>
		, selectRowByCheck : ${parameters.selectRowByCheck?string}
		</#if>	
		<#if parameters.submitUpdatedFields?exists>
		, submitUpdatedFields : ${parameters.submitUpdatedFields?string}
		</#if>	
		<#if parameters.minWidth?if_exists != "">
		, minWidth : "${parameters.minWidth?string}"
		</#if>
		<#if parameters.minHeight?if_exists != "">
		, minHeight : "${parameters.minHeight?string}"
		</#if>	
		<#if parameters.onClickCellTopics?exists>
		, onClickCell : function(value, record , cell, row,  colNO, rowNO,columnObj,grid) {
			return GT.Observer.publish("${parameters.onClickCellTopics?string?html}",[value, record , cell, row,  colNO, rowNO,columnObj,grid]);
			}
		</#if>	
		<#if parameters.onDblClickCellTopics?exists>
		, onDblClickCell : function(value, record , cell, row,  colNO, rowNO,columnObj,grid) {
			return GT.Observer.publish("${parameters.onDblClickCellTopics?string?html}",[value, record , cell, row,  colNO, rowNO,columnObj,grid]);
			}
		</#if>	
		<#if parameters.onClickHeadTopics?exists>
		, onClickHead : function(event,headCell,colObj,grid) {
			return GT.Observer.publish("${parameters.onClickHeadTopics?string?html}",[event,headCell,colObj,grid]);
			}
		</#if>			
		<#if parameters.onCompleteTopics?exists>
		, onComplete : function(grid) {
			return GT.Observer.publish("${parameters.onCompleteTopics?string?html}",[grid]);
			}
		</#if>
		<#if parameters.onShowTopics?exists>
		, onShow : function(grid) {
			return return GT.Observer.publish("${parameters.onShowTopics?string?html}",[grid]);
			}
		</#if>	
		<#if parameters.onResizeTopics?exists>
		, onResize : function(grid) {
			return GT.Observer.publish("${parameters.onResizeTopics?string?html}",[grid]);
			}
		</#if>						
		<#if parameters.onMouseMoveTopics?exists>
		, onMouseMove : function(event,grid) {
			return GT.Observer.publish("${parameters.onMouseMoveTopics?string?html}",[event,grid]);
			}
		</#if>					
		<#if parameters.beforeSelectRowTopics?exists>
		, beforeSelectRow : function(record ,row, rowNo, grid) {
			return GT.Observer.publish("${parameters.beforeSelectRowTopics?string?html}",[record ,row, rowNo, grid]);
			}
		</#if>	
		<#if parameters.afterSelectRowTopics?exists>
		, afterSelectRow : function(record ,row, rowNo, grid) {
			return GT.Observer.publish("${parameters.afterSelectRowTopics?string?html}",[record ,row, rowNo, grid]);
			}
		</#if>	
		<#if parameters.beforeEditTopics?exists>
		, beforeEdit : function(value,record,columnObj,grid) {
			return GT.Observer.publish("${parameters.beforeEditTopics?string?html}",[value,record,columnObj,grid]);
			}
		</#if>	
		<#if parameters.afterEditTopics?exists>
		, afterEdit : function(value,record,columnObj,grid) {
			return GT.Observer.publish("${parameters.afterEditTopics?string?html}",[value,record,columnObj,grid]);
			}
		</#if>			
		<#if parameters.beforeSaveTopics?exists>
		, beforeSave : function(requestParameter,grid) {
			return GT.Observer.publish("${parameters.beforeSaveTopics?string?html}",[requestParameter,grid]);
			}
		</#if>
		<#if parameters.beforeLoadTopics?exists>
		, beforeLoad : function(requestParameter,grid) {
			return GT.Observer.publish("${parameters.beforeLoadTopics?string?html}",[requestParameter,grid]);
			}
		</#if>				
		<#if parameters.beforeInsertTopics?exists>
		, beforeInsert : function(record,grid) {
			return GT.Observer.publish("${parameters.beforeInsertTopics?string?html}",[record,grid]);
			}
		</#if>	
		<#if parameters.afterInsertTopics?exists>
		, afterInsert : function(record,grid) {
			return GT.Observer.publish("${parameters.afterInsertTopics?string?html}",[record,grid]);
			}
		</#if>		
		<#if parameters.beforeUpdateTopics?exists>
		, beforeUpdate : function(record,fieldName,newValue) {
			return GT.Observer.publish("${parameters.beforeUpdateTopics?string?html}",[record,fieldName,newValue]);
			}
		</#if>	
		<#if parameters.afterUpdateTopics?exists>
		, afterUpdate : function(record,fieldName,newValue) {
			return GT.Observer.publish("${parameters.afterUpdateTopics?string?html}",[record,fieldName,newValue]);
			}
		</#if>			
		<#if parameters.beforeDeleteTopics?exists>
		, beforeDelete : function(record,row,grid) {
			return GT.Observer.publish("${parameters.beforeDeleteTopics?string?html}",[record,row,grid]);
			}
		</#if>	
		<#if parameters.afterDeleteTopics?exists>
		, afterDelete : function(record,row,grid) {
			return GT.Observer.publish("${parameters.afterDeleteTopics?string?html}",[record,row,grid]);
			}
		</#if>			
		<#if parameters.onUpdateRecordTopics?exists>
		, onUpdateRecord : function(grid) {
			return GT.Observer.publish("${parameters.onUpdateRecordTopics?string?html}",[grid]);
			}
		</#if>	
		<#if parameters.beforeGotoPageTopics?exists>
		, beforeGotoPage : function(grid) {
			return GT.Observer.publish("${parameters.beforeGotoPageTopics?string?html}",[grid]);
			}
		</#if>																																						
	};

	var ${parameters.id} = new GT.Grid(gridConfig);
	GT.Utils.onLoad(function() {
		${parameters.id}.render();
	});
</script>
